<?php


namespace app\admin\controller;


use app\admin\middleware\CheckAuth;
use app\admin\middleware\CheckLogin;
use app\admin\middleware\OperateLog;
use app\common\controller\Common;

class AController {

    /**
     * 登录中间件
     * 权限中间件
     * @var array
     */
    protected array $middleware = [
        CheckLogin::class,
        CheckAuth::class => [
            'only' 	=> ['index', 'add','edit', 'del']
        ],
        OperateLog::class
    ];

    protected function param($key=''){
        $data = request()->param($key);
        if (is_array($data)){
            unset($data['create_time']);
            unset($data['update_time']);
        }
        return $data;
    }

    protected function post($key=''){
        $data = request()->post($key);
        if (is_array($data)){
            unset($data['create_time']);
            unset($data['update_time']);
        }
        return $data;
    }


}
